home *** CD-ROM | disk | FTP | other *** search
/ JCSM Shareware Collection 1996 September / JCSM Shareware Collection (JCS Distribution) (September 1996).ISO / grapprog / pep.zip / CHAPT16.TXT < prev    next >
Text File  |  1994-10-19  |  22KB  |  419 lines

  1. <Chapter 16:  Hints, Tricks and Warnings>
  2.      In designing PEP, we have put a great deal of emphasis on
  3. flexibility. We have tried as much as possible to divide PEP's
  4. functionality into elementary features that you can control independently
  5. and combine to accomplish a wide variety of drawing goals. We have tried
  6. not to prejudge what your drawing tasks might be, or limit how you might
  7. combine PEP's features to accomplish them.
  8.  
  9.      But this flexibility carries a cost with it. Sometimes, to accomplish
  10. a simple thing it is necessary to change several settings, and the best
  11. approach to a given problem is often not obvious at first. In the
  12. preceding chapters, we have discussed, one by one, the individual
  13. functions that PEP offers. Here we give a few examples of how to use these
  14. features, especially in combination, to solve particular problems.
  15.  
  16. <Section 16.1:  How to Center Text>
  17.      In PEP, centered text is positioned between the left edge (L) and the
  18. right edge (R) of the text label box. If you want to produce centered
  19. text, first determine the coordinates L and R that you want to center the
  20. text between. Insert the text label at the left edge coordinate L. Then,
  21. in the MODIFY menu, change the following three properties of the text
  22. label. Use the JUSTIFY command <[4.13]> to set the justification to
  23. CENTER. Use the BOX command <[4.15]> to set the box mode to FIXED.
  24. Finally, use the WIDTH command <[4.16]> set the box width to (R - L), the
  25. distance between the left and right edges that you have chosen. <[FIG11]>.
  26.  
  27.      If you are inserting several centered labels, you may want to start
  28. by setting the justification, box mode, and width in the G-DEFAULTS menu
  29. <[10]>. Then you do not to have to modify each text label individually.
  30. The use of the words "left" and "right" above assumes that the text is not
  31. rotated, but the same principles apply to centering text in any rotation.
  32.  
  33. <Section 16.2:  How to Copy from One Object to Another>
  34.      Copying material within an object is easy: just use MODIFY/DUPLICATE
  35. <[4.2]>. If you are copying several elements, you may want to first use
  36. the COLLECT menu <[5]> to group the elements together, rather than copying
  37. each element individually.
  38.  
  39.      To copy material from one object to another, you need to know a
  40. trick. If you want to copy from object A to object B, first use
  41. OBJECT/OPEN <[7.1]> to display object A. Then delete the material you want
  42. to copy. (If you are copying many elements, you may want to use
  43. COLLECT/DELETE <[5.9]> to do this.) Next, open object B for editing,
  44. without closing object A. Use UN-DELETE <[3.1]> to insert the deleted
  45. material into object B. Because you did not save your changes to object A,
  46. this material is now present in both objects. The un-deleted material
  47. occupies the same position in object B that it occupies in object A. Use
  48. MODIFY/MOVE <[4.1]> if you need to reposition it.
  49.  
  50.      If objects A and B are not in the same file, proceed as follows.
  51. First, use FILE/LOAD <[8.2]> to load the file containing object B. Then
  52. use OBJECT/IMPORT <[7.8]> to copy object A into that file. Now that both
  53. objects are in the loaded file, you can use the trick described above to
  54. copy the material from A into B. Finally, use OBJECT/ELIMINATE <[7.6]> to
  55. remove, from the loaded file, the definition of object A, which you no
  56. longer need.
  57.  
  58. <Section 16.3:  Keeping Notes>
  59.      Sometimes you will make changes to your standard configuration of PEP
  60. when you are creating a picture. For example, you may install a different
  61. collection of fonts, or a different pattern file, or you may change the
  62. printer rotation to print sideways (landscape) rather than right side up
  63. (portrait). You will probably want to remember these changes in case you
  64. need to edit or print that picture again. The easiest way to do this is to
  65. create a separate object in that file, giving it the name NOTES. You can
  66. then type into that object, as text labels, all the relevant PEP settings,
  67. and any other information that you think you might need later when editing
  68. or printing the pictures in that file.
  69.  
  70. <Section 16.4:  Hidden Object Names>
  71.      A complex PDL file may contain a large number of different objects.
  72. It will often happen, however, that many objects in a file are seldom
  73. directly referred to. Once created, they are not re-edited, and they
  74. appear only as components of other objects. It is therefore convenient to
  75. split the menu of all object names into two parts, those objects
  76. frequently used, and the ones that are seldom referred to. You can
  77. accomplish this by using hidden object names.
  78.  
  79.      If you give an object a name beginning with the tilde character (~),
  80. that object becomes hidden. It does not appear directly in the menu of
  81. object names. Rather, that menu contains a single entry, ~HIDDEN, that
  82. represents all of the hidden objects. If you select this menu item, a
  83. second menu appears containing the names of just the hidden objects. In
  84. this way, you can select a hidden object if you wish, but the hidden names
  85. will not appear unless specifically requested.
  86.  
  87.      To hide an object name, add the tilde character to the start of the
  88. name using either OBJECT/CLOSE <[7.2]> or OBJECT/RENAME <[7.3]>. To
  89. un-hide the object, remove the tilde with OBJECT/RENAME.
  90.  
  91. <Section 16.5:  Default Object Definitions>
  92.      When PEP is first loaded, and whenever the FILE/NEW command is
  93. executed, PEP creates a new PDL file in memory. The new PDL data contains
  94. certain default object definitions. These defaults are obtained from the
  95. file AUTO.SAM. The version of AUTO.SAM supplied with PEP contains two
  96. objects, CIRCLE and BOX. If there are objects you use repeatedly, you may
  97. want to add them to the defaults. AUTO.SAM is an ordinary PDL file; you
  98. can modify its contents by editing with PEP. Use the FILE/EXTENSIONS menu
  99. <[8.5]> to change the LOAD and SAVE extensions to SAM. Edit AUTO.SAM as
  100. you would any PDL file. After saving your changes to disk, use
  101. QUIT/RESTART <[9.4]> to restart PEP with the new default definitions
  102. installed.
  103.  
  104. <Section 16.6:  Navigating Tricks>
  105.      If you are editing a large object and need to move the active
  106. graphics window from place to place in that object as you edit, you can
  107. accomplish this by simply using the shift NumPad keys. However, there are
  108. other techniques that are often more convenient.
  109.  
  110.      If you have another graphics window in total page mode, you can
  111. position the active window using this second window for reference.
  112. Position the cursor at a selected point in the total window, and use ALT-L
  113. <[14.3.10]> or ALT-U <[14.3.17]> to move the active window display. The
  114. result is that the center (or upper left corner) of the window is
  115. positioned at the selected point.
  116.  
  117.      Alternatively, you can temporarily set the active window to total
  118. page mode (ALT-T ALT-T <[14.3.16]> will do this), select a point in the
  119. active window, and use ALT-L or ALT-U as above to position the window at
  120. that point. The former window stretch values (temporarily overridden when
  121. you set total page mode) are restored to their correct values by these
  122. window positioning commands.
  123.  
  124.      If you are editing at one point in the object, and for accuracy you
  125. want to expand the magnification (ALT-E <[14.3.4]>) or go into fatdots
  126. mode (ALT-F <[14.3.5]>), by doing so you may move the relevant point out
  127. of the active window. To prevent this, begin by setting the jump location
  128. at that point via the ALT-J command <[14.3.9]>, then use ALT-E or ALT-F as
  129. required, and finally use ALT-M <[14.3.11]> to move the active window so
  130. that the selected point is once again on view.
  131.  
  132. <Section 16.7:  How to Edit a Font File>
  133.      It is possible in PEP to add new characters to a font and to edit the
  134. shapes of existing characters. A font file is essentially a PDL file like
  135. any other, except that the objects in the file (that is, the characters)
  136. do not have object names. Normally, the absence of object names would make
  137. it impossible to open and close the objects in this file, but PEP provides
  138. a trick to overcome this difficulty.
  139.  
  140.      To edit a font, first use FILE/EXTENSIONS/LOAD <[8.5.1]> and
  141. FILE/EXTENSIONS/SAVE <[8.5.2]> to change the extensions used when loading
  142. and saving picture files. Change both extensions from PDL to FON. Then use
  143. FILE/LOAD <[8.2]> to load the font file that you want to edit. Whenever
  144. the loaded picture file has the extension FON, the behavior of OBJECT/OPEN
  145. <[7.1]> and OBJECT/CLOSE <[7.2]> is changed. To open an object in a FON
  146. file, instead of specifying an object name, you either type in its
  147. numerical ASCII code or type a single or double quote followed by the
  148. character that you want to open. To open the upper case A character, for
  149. example, you could type any one of the following. (65 is the ASCII code
  150. for upper case A.)
  151.  
  152.   65
  153.   'A
  154.   "A
  155.  
  156.      These will open the upper case A from subset 0 of the font, the
  157. subset containing the normal style characters. To open a character from a
  158. different style subset, you can add 128 times the subset number to the
  159. ASCII code, or precede the character by the subset number and a colon. To
  160. open a bold italic lower case b, for example, any of the following will
  161. work (98 is the ASCII code for lower case b and subset 3 contains the bold
  162. italic characters):
  163.  
  164.   482
  165.   3:98
  166.   3:'b
  167.   3:"b
  168.  
  169. The same formulas apply when using OBJECT/CLOSE to close a new or
  170. modified character.
  171.  
  172.      If you are creating new symbols for a font, instead of replacing
  173. existing characters you might prefer to add the new symbols to an unused
  174. font subset. The BEAMOF font contains only normal style characters (subset
  175. 0); new symbols added to it could be placed in the italic set (subset 1),
  176. for example. Before creating a new symbol, you should first examine an
  177. existing character to determine the base line coordinate, the line styles
  178. used, and so forth. You will probably want your new symbols to be
  179. compatible with these values.
  180.  
  181.      When you have finished making all your changes to the font file, use
  182. FILE/SAVE to save it back to disk. Then use FILE/EXTENSIONS/LOAD and
  183. FILE/EXTENSIONS/SAVE once more to set the picture file extensions back to
  184. PDL.
  185.  
  186.      You are now ready to use the font that you have just edited. After
  187. saving the font file, you can use the SETUP/INSTALL menu <[12.5]> to
  188. install that font into PEP. If you changed a font that was already
  189. installed, you must nevertheless re-install the font after saving the
  190. changed font file to disk. Then the changed version will be available for
  191. you to use.
  192.  
  193.      The fonts supplied with PEP contain some extra information that is
  194. used when scaling characters to maintain the symmetries in certain
  195. characters, to preserve equal stroke weight and equal serif length across
  196. the entire font, and to improve the appearance of the characters in a
  197. variety of ways. This extra information cannot be edited graphically. If
  198. you add new characters to a font this extra information will be preserved.
  199. If you modify the contents of a character, however, this information may
  200. be lost. We recommend that you not modify the contents of the characters
  201. in the PEP fonts, but if you do, be sure to keep a backup copy of the
  202. original font.
  203.  
  204.      There are some restrictions that you should know on the kinds of
  205. elements that can appear in the character objects that make up a font. You
  206. should not use colors (other than FOREGROUND) in drawing a character. When
  207. PEP uses that character in a text label all color information is ignored.
  208. You should also not use pattern fills in a character, although solid
  209. filled regions are legal. Most importantly, you should never include a
  210. text label within a character. It is illegal for a character in a font to
  211. contain text labels among its elements. If you insert text into a
  212. character while you are editing a font file, it may cause a fatal error
  213. later when you try to install or use that font.
  214.  
  215. <Section 16.8:  Printing an Old Picture on a New Printer>
  216.      PEP pictures are device independent. You can print them at any size
  217. and in any proportions on any supported output device. So if you have
  218. created a picture to print on printer A, and now you want to print it on
  219. printer B and produce a picture of the same size and proportions, that
  220. must be possible. But how exactly do you do it?
  221.  
  222.      One approach is physically to measure the output from printer A and
  223. use the PRINT/IMAGE command <[6.9]>. This is a nuisance if you have many
  224. pictures to print. Here is an easier way which is also more accurate.
  225.  
  226.      First you have to know the printer resolutions. You can find the
  227. resolution of your installed printer by using the SETUP/NUMBERS/INCH
  228. command <[12.4.5]>. Say for example, that printer A is a 300 dot per inch
  229. LaserJet and printer B is an Epson FX80 in HI-RES mode. The Epson
  230. resolutions are 120 dots per inch horizontally and 144 vertically. Set the
  231. printer stretches to 120/300 in the X direction and 144/300 in the Y
  232. direction. See <[FIG15]>. In other words, the stretches are the new
  233. printer resolution divided by the old printer resolution. Now any object
  234. printed on printer B will have the same overall size as if it had been
  235. printed on printer A with unity stretches.
  236.  
  237.      Note: if you were printing in a landscape orientation, for example 90
  238. degree rotation, you would set X to 144/300 and Y to 120/300.
  239.  
  240. <Section 16.9:  Creating a Slide Show>
  241.      You can use PEP's configuration file capability to create slide
  242. shows. Configuration files are just recorded sequences of keystrokes. When
  243. PEP is first loaded (or is restarted) it executes the commands in its
  244. configuration file just as if they had been typed in from the keyboard.
  245. Thus anything you can do in PEP can be included in a slide show, but
  246. everything must be done from the keyboard; mouse motions are not recorded
  247. in configuration files.
  248.  
  249.      To create a slide, first use QUIT/MAKEFIG <[9.3]> to start the
  250. creation of a configuration file. Then execute any set of PEP commands to
  251. produce the screen image you want to use for your 1st slide. Then press
  252. ALT-H <[14.3.7]>. Next execute more commands to produce the 2nd slide and
  253. press ALT-H again. Repeat this process once for each slide, and finally
  254. press ALT-Z <[14.3.20]> to save the slide show file to disk.
  255.  
  256.      The ALT-H commands insert pause instructions into the configuration
  257. file. These are needed because keystrokes are read out of the slide show
  258. file much faster than they were typed in. It is the pause instruction
  259. which stops PEP execution long enough for the slide to become visible.
  260. Typing any key will end a pause.
  261.  
  262.      To run a slide show, use the /F and /P command line options when you
  263. load PEP. The /F option identifies the configuration file to use and the
  264. /P option specifies the length (in seconds) of the pause whenever an ALT-H
  265. is encountered in the file. If the /P option is omitted, then PEP will
  266. wait after each slide until the user presses a key on the keyboard. To
  267. omit the initial PEP greeting screen, add the /N option to the command
  268. line. For example, the command line:
  269.  
  270.      PEP /F=SHOW /P=2 /N
  271.  
  272. loads PEP without the initial greeting screen, executes the configuration
  273. file SHOW.FIG, and pauses for 2 seconds whenever an ALT-H is encountered
  274. in that file.
  275.  
  276.      One simple way to construct a slide show is to draw the slides as a
  277. sequence of objects in a PDL file. Then create a slide show configuration
  278. file that loads that PDL file and opens each object in succession with a
  279. pause after each.
  280.  
  281.      You can make a slide show that will repeat indefinitely by ending
  282. your configuration file with the QUIT/RESTART command <[9.4]> and
  283. selecting the new configuration file as the one to restart with.
  284.  
  285.      Configuration files contain only the standard printing ASCII
  286. characters, so that if you want to make small changes to a slide show, you
  287. may be able to do this more easily with a text editor than by re-creating
  288. the file in PEP. Certain keys are represented by a sequence of three
  289. characters, an underscore, and two others. Thus pressing the up-arrow
  290. while creating a configuration file inserts the three characters "_up"
  291. into the file. Pressing F1 inserts "_f1". Below is the complete list of
  292. the underscore sequences that may appear.
  293.  
  294.   _bs = backspace
  295.   _bt = tab
  296.   _ff = form feed
  297.   _es = escape
  298.   _us = underscore
  299.   _up = cursor up
  300.   _dn = cursor down
  301.   _lf = cursor left
  302.   _rt = cursor right
  303.   _hm = cursor up left (home key)
  304.   _en = cursor down left (end key)
  305.   _pu = cursor up right (pgup key)
  306.   _pd = cursor down right (pgdn key)
  307.   _g+ = auto-motion (grey +)
  308.   _g- = step size toggle (grey -)
  309.   _g* = stretch cursor corner (grey *)
  310.   _cl = word left (control left arrow)
  311.   _cr = word right (control right arrow)
  312.   _bk = break
  313.   _tb = backtab
  314.   _in = insert
  315.   _de = delete
  316.   _f1 = function key F1
  317.   _f2 = function key F2 etc.
  318.   _fa = function key F10
  319.   _x1 = ALT+function key F1
  320.   _x2 = ALT+function key F2 etc.
  321.   _aa = ALT+letter A
  322.   _ab = ALT+letter B etc.
  323.   _wu = window up (shift up)
  324.   _wd = window down (shift down)
  325.   _wl = window left (shift left)
  326.   _wr = window right (shift right)
  327.   _wh = window up left (shift home)
  328.   _we = window down left (shift end)
  329.   _w9 = window up right (shift pgup)
  330.   _w3 = window down right (shift pgdn)
  331.  
  332. <Section 16.10:  Postscript Output>
  333.      Most printers supported by PEP are bitmap devices. Each pixel printed
  334. is individually specified by PEP. Postscript printers are the exception to
  335. this rule. With Postscript, you have two options. When you install PEP,
  336. you can elect to use your Postscript printer as a bitmap device like any
  337. other printer, or you can choose to communicate with it at a higher level
  338. via the Postscript language <[17.2]>.
  339.  
  340.      The advantages of choosing the Postscript language option are that
  341. printing is normally faster in this case, color output is supported, and
  342. you have access to the standard Postscript fonts. There are additional
  343. advantages if you plan to output pictures to files in the encapsulated
  344. Postscript (EPS) format. Using EPS files you can incorporate pictures
  345. drawn in PEP into documents created by many word processors and page
  346. layout programs. These EPS files will typically be shorter if the higher
  347. level option has been selected, the picture will scale more smoothly when
  348. it is combined with other material in a document, and you can include
  349. device independent screen preview information (see below). You can enable
  350. encapsulated Postscript output by using the PRINT/DEVICE/OUTPUT command.
  351.  
  352.      However, if you output via Postscript, there will be some differences
  353. between the screen display of a picture and its appearance when printed.
  354. There are certain limitations in the translation from PEP's internal PDL
  355. representation into the Postscript language, and you should be aware of
  356. these.
  357.  
  358.      The following discussion assumes that you have selected the
  359. Output-Postscript option when you installed PEP. If you chose the
  360. Output-Bitmap-Graphics option, the remainder of this section does not
  361. apply.
  362.  
  363.      Each PEP font number is assigned to a distinct Postscript font. This
  364. assignment is fixed and independent of the PEP font also assigned to that
  365. number. Using the SETUP/INSTALL/FONT commands <[12.5.1]> will not effect
  366. the fonts used when printing to Postscript. The table below lists the PEP
  367. font numbers to be used when accessing the various Postscript fonts.
  368.  
  369.   Font 0   Times
  370.   Font 1   Helvetica
  371.   Font 2   ZapfChancery
  372.   Font 3   Bookman
  373.   Font 4   Palatino
  374.   Font 5   AvantGarde
  375.  
  376.      PEP will adjust the character spacing of these fonts to guarantee
  377. that each text label retains its correct label width when printed in
  378. Postscript. To override this correction and employ the native font metrics
  379. of the Postscript fonts, use the PRINT/DEVICE/TEXT-MODE command.
  380.  
  381.      Postscript pattern fill is accomplished by using halftone screens.
  382. Each PEP pattern number corresponds to a unique combination of size and
  383. spacing parameters for the halftone dots. Using the SETUP/INSTALL/PATTERNS
  384. <[12.5.2]> command does not change the Postscript pattern produced by a
  385. given PEP pattern number. Since halftone screens are implicitly used when
  386. producing colored images, patterns are suppressed by PEP if a filled
  387. region has a color other than black. You can avoid this elimination of
  388. patterns by using the PRINT/DEVICE/BLACK-ONLY command to disable colors in
  389. the Postscript output.
  390.  
  391.      Finally, the Postscript language does not support the range of
  392. nibtypes that can be used when drawing lines in PEP. We recommend that,
  393. for Postscript output, you use only the point and ellipse nibs. Note that
  394. the graphics libraries supplied with PEP often employ nibtypes not
  395. supported by Postscript. In some cases, objects from these files will not
  396. be faithfully reproduced when translated into Postscript.
  397.  
  398.      If you are printing an object that contains colors and you have a
  399. black and white Postscript printer, the different colors will be rendered
  400. as various shades of gray. If you want to avoid gray levels and print
  401. everything in uniform black, use the PRINT/DEVICE/BLACK-ONLY command.
  402.  
  403.      You can include device independent (EPSI) screen preview data in EPS
  404. files produced by PEP. Use the PRINT/DEVICE/PREVIEW command to enable the
  405. inclusion of EPSI bitmap data. Applications that support EPSI preview will
  406. then be able to display a representation of the EPS file image on screen
  407. for easier manipulation. EPSI data is stored as ASCII text comment fields
  408. in the EPS file and will be ignored by any application not supporting EPSI
  409. previews.
  410.  
  411.      The inclusion of preview data will substantially increase the size of
  412. an EPS file, and there is a trade-off between the accuracy of the preview
  413. image and the amount of extra file storage required. You can control the
  414. increase in file size by using the PRINT/DEVICE/LIMIT-SIZE command to
  415. specify a maximum amount of preview data to add to each file. Press the
  416. command letter and enter the preview limit size in kilobytes. Larger
  417. amounts result in finer resolutions. This command has no effect unless
  418. EPSI preview output is enabled.